/*
 * Femto OS v 0.92 - Copyright (C) 2008-2010 Ruud Vlaming
 *
 * This file is part of the Femto OS distribution.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Please note that, due to the GPLv3 license, for application of this
 * work and/or combined work in embedded systems special obligations apply.
 * If these are not to you liking, please know the Femto OS is dual
 * licensed. A commercial license and support are available.
 * See http://www.femtoos.org/ for details.
 */

/**
 * This file is solely for demonstration purposes.
 *
 * The Hello World example is made to get you started and this is the file
 * you want to play with. Do not use other examples to that end, that will
 * be a disappointing experience (or a steep learning curve)
 *
 * Explanation on the website, point your browser at:
 * http://www.femtoos.org/code_start.html
 */

/* This this the only include needed in your code .*/
#include "femtoos_code.h"
#include "serial.h"
#include "adc.h"

//---------------------------
//  Initialization Procedure
//---------------------------
void appBoot(void)
{   
	InitSerial();
	InitAdc();
}

//-----------------------
//  Task 1 Procedure : Led
//-----------------------
#if (preTaskDefined(taskLed))
void appLoop_taskLed(void)
{ 
    DDR_LED=DDR_LED_MASK;
    while(true)
	{
	    PORT_LED=~DDR_LED_MASK|LED_MASK_ON;
	    taskDelayFromNow(10);
	    PORT_LED=~DDR_LED_MASK|LED_MASK_OFF;
	    taskDelayFromNow(2000);
	}
}
#endif


//-----------------------
//  Task 2 Procedure : Serial
//-----------------------
#if (preTaskDefined(taskSerial))
void appLoop_taskSerial(void)
{ 
	ShowWMessage();
	while(true)
	{
		ExecCmd();
	}   
	
}
#endif
